<?php echo $this->doctype() ;
$service= Application_Model_service_TaiKhoanService::getInstance();
$service instanceof Application_Model_serviceInf_TaiKhoanServiceInf;
$user=$service->isLogin();
$user instanceof Application_Model_bean_TaiKhoan;

$isAdmin=$service->isAdmin();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mobile Store</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php echo $this->headLink()->appendStylesheet('../style.css') ?>
<?php echo $this->headLink()->appendStylesheet('../sanPhamStyle.css') ?>
<?php echo $this->headLink()->appendStylesheet('../MenuMatic.css') ?>
<!--[if lt IE 7]>
			<link rel="stylesheet" href="../MenuMatic-ie6.css" type="text/css" media="screen" charset="utf-8" />
<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iecss.css" />
<?php echo $this->headLink()->appendStylesheet('../iecss.css') ?>
<![endif]-->
<script type="text/javascript" src="../js/boxOver.js"></script>
<script type="text/javascript" src="../js/mootools.js"></script>
<script type="text/javascript" src="../js/myscript.js"></script>
<script type="text/javascript" src="../js/bumpbox.js"></script>
<script type="text/javascript" src="../js/nicEdit.js"></script>

<script type="text/javascript" src="http://www.google.com/jsapi" ></script>   
<script type="text/javascript" src="../js/MenuMatic_0.68.3.js" ></script> 
</head>
<body>
<div id="logRespont" style="display: none;"></div>
<div id="logThongBao"></div>
<div id="main_container">
  <div class="top_bar">
    <div class="top_search">
      <div class="search_text"><a href="#">Tìm kiếm nhanh</a></div>
      <form action="/sanpham/timnhanh" method="get">
	      <input type="hidden" name="pa" value="1">
	      <input type="hidden" name="lm" value="2">
	      <input type="text" class="search_input" name="ten" />
	      <input type="image" src="../images/search.gif" class="search_bt"/>
      </form>
    </div>
    <div class="languages">
      <div class="lang_text" style="width: 600px;">
      	<?php 
      		if($user!=null){
      			?>
      			Chào mừng <?php echo $user->getUsername()?> | 
      			<a href="../tai-khoan/logout" title="header=[Thoát] body=[&nbsp;] fade=[on]" ><img style="vertical-align: middle;" src="../images/logout.png" alt="" border="0"  /></a>
      			<?php 
      		}else {
      			echo 'Chào mừng bạn đến website của chúng tôi | <a href="../tai-khoan/login" title="header=[Đăng nhập] body=[&nbsp;] fade=[on]" ><img style="vertical-align: middle;" src="../images/login.png" alt="" border="0"  /></a> ';
      		}
      	?>
      </div>
      <?php 
      if($isAdmin){
      	?>
      	 <ul id="nav" style="margin-top: -10px;">  
		     <li><a href="#" >Quản lý admin</a>  
		         <ul>  
		             <li><a href="#" >Sản phẩm</a>
		             	<ul>
		             		<li><a href="../sanpham/new">Tạo sản phẩm</a> </li>
		             		<li><a href="../sanpham/quanlysanpham">Quản lý sản phẩm</a> </li>
		             		<li><a href="#">Danh mục</a> 
		             			<ul>
		             				<li><a href="../danh-muc/new">Tạo danh mục</a> </li>
		             				<li><a href="../danh-muc/quanlydanhmuc">Quản lý danh mục</a> </li>
		             			</ul>
		             		</li>
		             		<li><a href="#">Chức năng</a> 
		             			<ul>
		             				<li><a href="../chuc-nang-san-pham/new">Tạo nhóm chức năng</a> </li>
		             				<li><a href="../chuc-nang-san-pham/tao-item">Tạo chức năng</a> </li>
		             			</ul>
		             		</li>
		             	</ul>
		             </li>  
		             <li><a href="#" >Tin tức</a>
		             <ul>
		             		<li><a href="../ban-tin/get-all-ban-tin">Quan Ly Ban Tin</a> </li>
		             		<li><a href="../ban-tin/new">Tao Ban Tin</a> </li>
		             		
		             		<li><a href="../danh-muc-ban-tin/load">Quan Ly Danh Muc Ban Tin</a> </li>
		             		<li><a href="../danh-muc-ban-tin/new">Tao Danh Muc Ban Tin</a> </li>
		             	</ul>
		             </li>
		             <li><a href="#" >Phiếu hàng</a>
		             	<ul>
		             		<li><a href="../phieu-dat-hang/getallphieudathangchuaxuly">Chưa xử lý</a> </li>
		             		<li><a href="../phieu-dat-hang/getallphieudathangdaxuly">Đã xử lý</a> </li>
		             		<li><a href="../phieu-dat-hang/getallphieudathanghuy">Đã hủy</a> </li>
		             	</ul>
		             </li>  
		              <li><a href="#" >Tài Khoản</a>
		             	<ul>
					 		<li><a href="../tai-khoan/manage">Quản lý</a> </li>
		             	</ul>
		             </li> 
		         </ul>  
		     </li>  
		 </ul>  
		 <script type="text/javascript">
			// cai dat menu
			var myMenu = new MenuMatic();
		 </script>
      	<?php 
      }
      ?>
      
    </div>
  </div>
  <div id="header">
    <div id="logo"> <a href="../index.php"><img src="../images/logo2.png" alt="" border="0" width="237" height="140" /></a> </div>
    <div class="oferte_content">
      <div class="top_divider"><img src="../images/header_divider.png" alt="" width="1" height="164" /></div>
      <div class="oferta">
        <div class="oferta_content"> <img src="../images/laptop.png" width="94" height="92" alt="" border="0" class="oferta_img" />
          <div class="oferta_details">
            <div class="oferta_title">Samsung GX 2004 LM</div>
            <div class="oferta_text"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco </div>
            <a href="details.html" class="details">details</a> </div>
        </div>
        <div class="oferta_pagination"> <span class="current">1</span> <a href="../index.php">2</a> <a href="../index.php">3</a> <a href="../index.php">4</a> <a href="../index.php">5</a> </div>
      </div>
      <div class="top_divider"><img src="../images/header_divider.png" alt="" width="1" height="164" /></div>
    </div>
    <!-- end of oferte_content-->
  </div>
  <div id="main_content">
    <div id="menu_tab">
      <div class="left_menu_corner"></div>
      <ul class="menu">
        <li><a href="../index.php" class="nav1"> Trang chủ</a></li>
        <li class="divider"></li>
        <li><a href="../sanpham/get-list?lm=12&pa=1&g=0&ten=&maDM=&mcn=" class="nav2">Sản phẩm</a></li>
        <li class="divider"></li>
        <li><a href="../index.php" class="nav3">Tin tức</a></li>
        <li class="divider"></li>
        <?php 
        if($user!=null){
        	echo '<li><a href="../tai-khoan/chitietkhachhang" class="nav4">Tài khoản</a></li>
        <li class="divider"></li>';
        }else {
        	echo '<li><a href="../tai-khoan/new" class="nav4">Đăng ký</a></li>
        <li class="divider"></li>';
        }
        ?>
        <li><a href="../index/contact" class="nav6">Liên hệ</a></li>
        <li class="currencies" style="margin-left: 140px;">Tiền mặt: 
          <select>
            <option>US Dollar</option>
          </select>
        </li>
      </ul>
      <div class="right_menu_corner"></div>
    </div>
    <!-- end of menu tab -->
    <div class="crumb_navigation" > Navigation: <span class="current">Home</span> </div>
    <div class="left_content">
      <div class="title_box">Danh mục sản phẩm</div>
      <ul class="left_menu" id="logDanhMucList" >
      </ul>
      <div class="title_box">Sản phẩm đặc biệt</div>
      <div class="border_box">
        <div class="product_title"><a href="details.html">Motorola 156 MX-VL</a></div>
        <div class="product_img"><a href="details.html"><img src="../images/laptop.png" alt="" border="0" /></a></div>
        <div class="prod_price"><span class="reduce">350$</span> <span class="price">270$</span></div>
      </div>
      <div class="title_box">Newsletter</div>
      <div class="border_box">
        <input type="text" name="newsletter" class="newsletter_input" value="your email"/>
        <a href="../index.php" class="join">join</a> </div>
      <div class="banner_adds"> <a href="../index.php"><img src="../images/bann2.jpg" alt="" border="0" /></a> </div>
    </div>
    <!-- end of left content -->
    <div class="center_content" id="logContent">
    	
      <?php echo $this->layout()->content;?>
    </div>
    <!-- end of center content -->
    <div class="right_content">
      <div class="shopping_cart" id="logCartInfo">
        <div class="cart_title">Shopping cart</div>
        <div class="cart_details"> 0 items <br />
          <span class="border_cart"></span> Total: <span class="price">0$</span> </div>
        <div class="cart_icon"><a href="../index.php" title="header=[Checkout] body=[&nbsp;] fade=[on]"><img src="../images/shoppingcart.png" alt="" width="48" height="48" border="0" /></a></div>
      </div>
      <div class="title_box">What’s new</div>
      <div class="border_box">
        <div class="product_title"><a href="details.html">Motorola 156 MX-VL</a></div>
        <div class="product_img"><a href="details.html"><img src="../images/p2.gif" alt="" border="0" /></a></div>
        <div class="prod_price"><span class="reduce">350$</span> <span class="price">270$</span></div>
      </div>
      <div class="title_box">Manufacturers</div>
      <ul class="left_menu">
        <li class="odd"><a href="../index.php">Sony</a></li>
        <li class="even"><a href="../index.php">Samsung</a></li>
        <li class="odd"><a href="../index.php">Daewoo</a></li>
        <li class="even"><a href="../index.php">LG</a></li>
        <li class="odd"><a href="../index.php">Fujitsu Siemens</a></li>
        <li class="even"><a href="../index.php">Motorola</a></li>
      </ul>
      <div class="banner_adds"> <a href="../index.php"><img src="../images/bann1.jpg" alt="" border="0" /></a> </div>
    </div>
    <!-- end of right content -->
  </div>
  <!-- end of main content -->
  <div class="footer">
    <div class="left_footer"> <img src="../images/footer_logo.png" alt="" width="170" height="49"/> </div>
    <div class="center_footer"> Template name. All Rights Reserved 2008<br />
      <a href="http://csscreme.com"><img src="../images/csscreme.jpg" alt="csscreme" border="0" /></a><br />
      <img src="../images/payment.gif" alt="" /> </div>
    <div class="right_footer"> <a href="../index.php">home</a> <a href="../index.php">about</a> <a href="../index.php">sitemap</a> <a href="../index.php">rss</a> <a href="contact.html">contact us</a> </div>
  </div>
</div>
<!-- end of main_container -->
<script type="text/javascript">
	window.addEvent('domready', function(){
		//update thong tin gio hang
		updateInfoCart();
		//load left menu
		var urlLoadDanhMuc=rootURL+"/danh-muc/load";
		var logUpdate=$('logDanhMucList');
		var data={};
		var successFuntion=function(){};
		requestAdv(urlLoadDanhMuc,logUpdate,data,successFuntion);
		// cai dat bumpbox
		bumpbox();
		
		//adddcart action
		addCartRegist();
		});

	window.addEvent('scroll',function(){
		var dom=$('logThongBao');
		dom.setStyle('top', window.getScrollTop());
	});
</script>
</body>
</html>